<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"
    import="org.windblog.core.*,org.windblog.core.entity.*,java.util.Date,java.util.List" %>
<%
Post post = WBQuery.getCurrentPost();
if(post.isPasswordRequired())
{
%>
<p class="nocomments">This post is password protected. Enter the password to view comments.</p>
<%
}
%>

<!-- You can start editing here. -->

<%
	List<Comment> comments = post.getComments();
	if(comments.size()>0 ){ %>
	<h3 id="comments"><%=comments.size() %> Response to &#8220;<%=post.getTitle()%>&#8221;</h3>

	<ol class="commentlist">
		
	<%
		for(Comment comment : comments)
		{
			if(OptionService.getOptionValue("comment_review").equals("false")||comment.isApproved()){
	%>
		<li class="comment byuser comment-author-admin bypostauthor even thread-even depth-1" id="comment-2">
			<div id="div-comment-2">
				<div class="comment-author vcard">
					<img alt='' src='http://www.gravatar.com/avatar/c4b0b0fc5d132ed5cd1c870244097475?s=32&amp;d=http%3A%2F%2Fwww.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D32&amp;r=G' class='avatar avatar-32 photo' height='32' width='32' />		
					<cite class="fn"><%=comment.getAuthor() %></cite> 
					<span class="says">says:</span>		
				</div>
 
				<div class="comment-meta commentmetadata">
					<a href="http://127.0.0.1/wordpress/?p=3&amp;cpage=1#comment-2"><%=comment.getDate().toString() %></a>&nbsp;&nbsp;
					<a class="comment-edit-link" href="editc">(Edit)</a>
				</div>
				<p><%=comment.getContent() %></p>
			</div>
		</li>
	<%
		}
		}
	%>
	</ol>
	<%}else{%>
		<%if(post.getCommentStatus().equals("ALLOW_COMMENTS")){%>
			<!-- If comments are open, but there are no comments. -->
		<%}else{ %>
			<!-- If comments are closed. -->
			<p class="nocomments">Comments are closed.</p>
	<%}
	}
	%>


<%if(post.getCommentStatus().equals("ALLOW_COMMENTS")){ %>

<div id="respond">

<h3>Leave a Reply</h3>

<form action="/addcomment" method="post" id="commentform">

<p><input type="text" name="name" id="author" size="22" tabindex="1" />
<label for="author"><small>Name <?php if ($req) echo "(required)"; ?></small></label></p>

<p><input type="text" name="email" id="email"  size="22" tabindex="2" />
<label for="email"><small>Mail (will not be published)</small></label></p>

<p><input type="text" name="url" id="url" size="22" tabindex="3" />
<label for="url"><small>Website</small></label></p>

<p><textarea name="content" id="comment" cols="100%" rows="10" tabindex="4"></textarea></p>

<p><input name="submit" type="submit" id="submit" tabindex="5" value="Submit Comment" />
<input name="post" type="hidden" value="<%=post.getStrKey()%>"/>
</p>

</form>

</div>
 <%}%>